package com.rainng.coursesystem.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rainng.coursesystem.model.bo.EventItemBO;
import com.rainng.coursesystem.model.bo.MemberEventSelectItemBO;
import com.rainng.coursesystem.model.entity.EventEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface EventMapper extends BaseMapper<EventEntity> {
    Integer count(@Param("areaName")String areaName, @Param("leaderName")String leaderName, @Param("name")String name);

    IPage<EventItemBO> getPage(IPage<EventItemBO> page, @Param("areaName")String areaName, @Param("leaderName")String leaderName, @Param("name")String name);

    Integer countMemberCanSelect(@Param("memberId")Integer memberId, @Param("areaId")Integer areaId, @Param("number")Integer number, @Param("eventName")String eventName, @Param("leaderName")String leaderName);

    IPage<MemberEventSelectItemBO> getMemberCanSelectPage(IPage<MemberEventSelectItemBO> page, @Param("memberId") Integer memberId, @Param("areaId")  Integer areaId, @Param("number") Integer number, @Param("eventName") String eventName, @Param("leaderName") String leaderName);

    Integer getAreaIdById(Integer eventId);
}
